package visualisation;

import javax.swing.JFrame;
import javax.swing.JScrollPane;

import neuralNetworks.NeuralNetwork;
import neuralNetworks.Neuron;

public class NNFrame extends JFrame {

	private static final long serialVersionUID = 6516794129797180363L;

	public NNFrame(NeuralNetwork<? extends Neuron> nnet) {
		this.setTitle("NNFrame");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		addNNet(nnet);
		// this.setPreferredSize(new Dimension(640,480));
		this.setVisible(true);
	}

	public void addNNet(NeuralNetwork<? extends Neuron> nnet) {
		NNPanel nnpan = new NNPanel(nnet);
		this.getContentPane().add(
				new JScrollPane(nnpan, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS));
		// this.getContentPane().add(new NNetComp(nnet));
		// this.setPreferredSize(new Dimension(800,600));
		this.pack();
	}

}
